package org.jaaksi.svcmanager;

import android.os.IBinder;
import android.os.RemoteException;
import java.util.concurrent.ConcurrentHashMap;

public class ServiceChannelImpl extends IServiceChannel.Stub {

  private static ConcurrentHashMap<String, IBinder> sServices =
    new ConcurrentHashMap<String, IBinder>();

  @Override public IBinder getService(String serviceName) throws RemoteException {
    return sServices.get(serviceName);
  }

  @Override public void addService(String serviceName, IBinder ibinder) throws RemoteException {
    sServices.put(serviceName, ibinder);
  }

  @Override public void removeService(String serviceName) throws RemoteException {
    sServices.remove(serviceName);
  }
}
